t1_s2 = t1(2:end);
dt = t1_s2-t1(1:end-1);

dv = v1(2:end)-v1(1:end-1);
v_avg = (v1(2:end)+v1(1:end-1))/2;
c1_s1 = c1(1:end-1)-(7.849-7.743*exp(-0.04106*v1(1:end-1))-0.2468*v1(1:end-1));

f = fit(c1_s1,dv,'poly1')
plot(f,c1_s1,dv);

r =[0];
r(2,1) = (v1(2)-(61.2*c1(1)-5362)+r(1,1))/100000;

for i = 3:size(dt,1)
    r(i,1) = (v1(i)-(61.2*c1(2)-5362)+r(i-1,1))/100000;
end

dr = r(2:end)-r(1:end-1)